#include "common.h"

#include <TensorDense.h>
#include <TensorMathElementwise.h>

BOOST_AUTO_TEST_SUITE(TensorDenseMath_Tests)
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Add, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t2 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,0,6]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemAdd(t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[4,6,8;10,12,14;16,8,15]");
    BOOST_CHECK(t3 == t4);
    t1.ElemAddTo(t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t3c = t1c.ElemAdd(2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,10,11]");
    BOOST_CHECK(t3c == t4c);
    t1c.ElemAddTo(2);
    BOOST_CHECK(t1c == t4c);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Subtract, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t2 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,2;2,2,1;4,3,1]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemSubtract(t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;2,3,5;3,5,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemSubtractTo(t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[2,3,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t3c = t1c.ElemSubtract(2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,1;2,3,4;5,6,7]");
    BOOST_CHECK(t3c == t4c);
    t1c.ElemSubtractTo(2);
    BOOST_CHECK(t1c == t4c);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Multiply, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t2 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,2;2,2,1;4,3,1]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemMultiply(t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,2,6;8,10,6;28,24,9]");
    BOOST_CHECK(t3 == t4);
    t1.ElemMultiplyTo(t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t3c = t1c.ElemMultiply(2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[2,4,6;8,10,12;14,16,18]");
    BOOST_CHECK(t3c == t4c);
    t1c.ElemMultiplyTo(2);
    BOOST_CHECK(t1c == t4c);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Divide, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[5,4,15;14,12,6;12,9,9]");
    cmpMat::TensorDense<TEST_TYPE> t2 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[5,2,5;2,2,1;4,3,1]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemDivide(t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;7,6,6;3,3,9]");
    BOOST_CHECK(t3 == t4);
    t1.ElemDivideTo(t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[2,4,16;14,12,6;12,8,8]");
    cmpMat::TensorDense<TEST_TYPE> t3c = t1c.ElemDivide(2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,8;7,6,3;6,4,4]");
    BOOST_CHECK(t3c == t4c);
    t1c.ElemDivideTo(2);
    BOOST_CHECK(t1c == t4c);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Pow2, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[5,4,1;4,2,6;2,9,9]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemPow2();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[25,16,1;16,4,36;4,81,81]");
    BOOST_CHECK(t3 == t4);
    t1.ElemPow2To();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Sin, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemSin();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemSinTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Cos, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemCos();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;1,1,1;1,1,1]");
    BOOST_CHECK(t3 == t4);
    t1.ElemCosTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Tan, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemTan();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemTanTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Abs, TEST_TYPE, signed_numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[-1,2,-3;4,-4,5;6,-7,-8]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemAbs();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemAbsTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_lAbs, TEST_TYPE, signed_numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[-1,2,-3;4,-4,5;6,-7,-8]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemlAbs();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemlAbsTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_llAbs, TEST_TYPE, signed_numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[-1,2,-3;4,-4,5;6,-7,-8]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemllAbs();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemllAbsTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_fAbs, TEST_TYPE, signed_numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[-1,2,-3;4,-4,5;6,-7,-8]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemfAbs();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemfAbsTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Acos, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;1,1,1;1,1,1]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemAcos();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemAcosTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Asin, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemAsin();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemAsinTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Atan, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemAtan();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemAtanTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Cosh, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemCosh();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;1,1,1;1,1,1]");
    BOOST_CHECK(t3 == t4);
    t1.ElemCoshTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Exp, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemExp();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;1,1,1;1,1,1]");
    BOOST_CHECK(t3 == t4);
    t1.ElemExpTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Log, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,1,1;1,1,1;1,1,1]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemLog();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemLogTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Log10, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,10,100;1000,10000,10000;10,100,1000]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemLog10();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,2;3,4,4;1,2,3]");
    BOOST_CHECK(t3 == t4);
    t1.ElemLog10To();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Sinh, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemSinh();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemSinhTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Tanh, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemTanh();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,0,0;0,0,0;0,0,0]");
    BOOST_CHECK(t3 == t4);
    t1.ElemTanhTo();
    BOOST_CHECK(t1 == t4);
}
BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Sqrt, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,4;9,16,25;36,49,64]");
    cmpMat::TensorDense<TEST_TYPE> t3 = t1.ElemSqrt();
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,2;3,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    t1.ElemSqrtTo();
    BOOST_CHECK(t1 == t4);
}

BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Add_BASE, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1d = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t2d = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,0,6]");
    cmpMat::TensorBase<TEST_TYPE>& t1 = t1d;
    cmpMat::TensorBase<TEST_TYPE>& t2 = t2d;
    cmpMat::TensorDense<TEST_TYPE> t3 = cmpMat::TensorMathElementwise::Add<cmpMat::TensorDense, TEST_TYPE>(t1, t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[4,6,8;10,12,14;16,8,15]");
    BOOST_CHECK(t3 == t4);
    cmpMat::TensorMathElementwise::AddTo(t1, t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1cd = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorBase<TEST_TYPE>& t1c = t1cd;
    cmpMat::TensorDense<TEST_TYPE> t3c = cmpMat::TensorMathElementwise::Add<cmpMat::TensorDense, TEST_TYPE>(t1c, 2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,10,11]");
    BOOST_CHECK(t3c == t4c);
    cmpMat::TensorMathElementwise::AddTo(t1c, 2);
    BOOST_CHECK(t1c == t4c);
}


BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_Add_ELEMENTWISE, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t2 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,0,6]");
    cmpMat::TensorDense<TEST_TYPE> t3 = cmpMat::TensorMathElementwise::Add<cmpMat::TensorDense, TEST_TYPE>(t1, t2);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[4,6,8;10,12,14;16,8,15]");
    BOOST_CHECK(t3 == t4);
    cmpMat::TensorMathElementwise::AddTo(t1, t2);
    BOOST_CHECK(t1 == t4);

    cmpMat::TensorDense<TEST_TYPE> t1c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[1,2,3;4,5,6;7,8,9]");
    cmpMat::TensorDense<TEST_TYPE> t3c = cmpMat::TensorMathElementwise::Add<cmpMat::TensorDense, TEST_TYPE>(t1c, 2);
    cmpMat::TensorDense<TEST_TYPE> t4c = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[3,4,5;6,7,8;9,10,11]");
    BOOST_CHECK(t3c == t4c);
    cmpMat::TensorMathElementwise::AddTo(t1c, 2);
    BOOST_CHECK(t1c == t4c);
}


BOOST_AUTO_TEST_CASE_TEMPLATE(TensorDense_ElemMath_SqrtE_ELEMENTWISE, TEST_TYPE, numeric_types)
{
    cmpMat::TensorDense<TEST_TYPE> t1 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,4;9,16,25;36,49,64]");
    cmpMat::TensorDense<TEST_TYPE> t3 = cmpMat::TensorMathElementwise::Sqrt<cmpMat::TensorDense>(t1);
    cmpMat::TensorDense<TEST_TYPE> t4 = 
        cmpMat::TensorDense<TEST_TYPE>::loadFromMAT("[0,1,2;3,4,5;6,7,8]");
    BOOST_CHECK(t3 == t4);
    cmpMat::TensorMathElementwise::SqrtTo(t1);
    BOOST_CHECK(t1 == t4);
}

BOOST_AUTO_TEST_SUITE_END()
